/*
 * EliminarTareaAction.java
 *
 * Created on 25 de enero de 2008, 08:39 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package perucuy.logic;

/**
 *
 * @author OMATEO
 */
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.Timer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;
import perucuy.domain.Mensaje;

import perucuy.services.TareaService;
import perucuy.transfers.TareaTO;
import perucuy.transfers.UsuarioTO;
import perucuy.utils.Constantes;
public class EliminarTareaAction extends Action {
    private static Logger log = Logger.getLogger(EliminarTareaAction.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws InvocationTargetException, IllegalAccessException, FileNotFoundException, IOException {
        String codigo = request.getParameter("codtarea");
        if (codigo!=null && !codigo.equals("")){
            TareaService tareasvr = new TareaService();
            int r = tareasvr.eliminarTarea(Integer.parseInt(codigo));
            log.debug("Tarea eliminada, como resultado: "+r);
        }
        return mapping.findForward("success");
    }
}
